package com.jf.anmocker.plugin.mockcore.asm

import org.objectweb.asm.AnnotationVisitor
import org.objectweb.asm.Opcodes

class AnMockerAnoVisitor(annotationVisitor : AnnotationVisitor, api : Int = Opcodes.ASM6) : AnnotationVisitor(api, annotationVisitor) {

    var name : String? = null
    var value : Any? = null

    override fun visit(name: String?, value: Any?) {
        val type : String = value?.let{
            value::class.java.name
        } ?: "null-type"
        println("annotationVisitor name = [$name] value = [$value] >> $type")
        this.name = name
        this.value = value
        super.visit(name, value)
    }

    fun getAnoName() :String? {
        return name
    }

    fun getAnoValue() :Any? {
        return value
    }
}